ME314 Homework 6 (Template)

Please note that a single PDF file will be the only document that you turn in, which will include your answers to the problems with corresponding derivations and any code used to complete the problems. When including the code, please make sure you also include code outputs, and you don't need to include example code. Problems and deliverables that should be included with your submission are shown in bold.

This Juputer Notebook file serves as a template for you to start homework, since we recommend to finish the homework using Jupyter Notebook. You can start with this notebook file with your local Jupyter environment, or upload it to Google Colab. You can include all the code and other deliverables in this notebook Jupyter Notebook supports $\LaTeX$ for math equations, and you can export the whole notebook as a PDF file. But this is not the only option, if you are more comfortable with other ways, feel free to do so, as long as you can submit the homework in a single PDF file.


Problem 1 (20pts)

Show that if $R(\theta_1)$ and $R(\theta_2)\in SO(n)$ then the product is also a rotation matrix; that is $R(\theta_1)R(\theta_2)\in SO(n)$.

Hint 1: You know this is true when $n=2$ by direct calculation in class, but for $n\neq2$ you should use the definition of $SO(n)$ to verify it for arbitrary $n$. Do not try to do this by analyzing individual components of the matrix.

Turn in: A scanned (or photograph from your phone or webcam) copy of your hand written solution. You can also use \LaTeX. If you use SymPy, then you just need to include a copy of code and the code outputs, with notes that explain why the code outputs could explain the results.

Problem 2 (20pts)

Show that if $g(x_1,y_1,\theta_1)$ and $g(x_2,y_2,\theta_2)\in SE(2)$ then the product satisfies $g(x_1,y_1,\theta_1)g(x_2,y_2,\theta_2)\in SE(2)$.

Turn in: A scanned (or photograph from your phone or webcam) copy of your hand written solution. You can also use \LaTeX. If you use SymPy, then you just need to include a copy of code and the code outputs, with notes that explain why the code outputs could explain the results.

Problem 3 (20pts)

Show that any homogeneous transformation in SE(2) can be separated into a rotation and a translation. What's the order of the two operations, which comes first? What's different if we flip the order in which we compose the rotation and translation?

Hint 1: For the rotation and translation operation, we first need to know what's the reference frame for these two operations.

Turn in: A scanned (or photograph from your phone or webcam) copy of your hand written solution. You can also use \LaTeX. If you use SymPy, then you just need to include a copy of code and the code outputs, with notes that explain why the code outputs could explain the results.

Problem 4 (20pts)

Simulate the same double-pendulum system in previous homework using only homogeneous transformation (and thus avoid using trigonometry). Simulate the system for $t\in[0,5]$ with $dt=0.1$. The parameters are $m_1=m_2=1, R_1=R_2=1, g=9.8$ and initial conditions are $\theta_1=\theta_2=-\frac{\pi}{2}, \dot{\theta}_1=\dot{\theta}_2=0$. Do not use functions provided in the modern robotics package for manipulating transformation matrices such as RpToTrans().

Hint 1: Same as in the lecture, you will need to define the frames by yourself in order to compute the Lagrangian. An example is shown below.

Turn in: A copy of code used to simulate the system, and the plot of the trajectory of $\theta_1$ and $\theta_2$. Also, attach a figure showing how you define the frames.

Problem 5 (20pts)

Modify the previous animation function for the double-pendulum, such that the animation could show the frames you defined in the last problem (it's similar to the ''tf'' in RViz, if you're familiar with ROS). All the x axes should be displayed in green and all the y axes should be displayed in red, all axes have the length of 0.3. An example can be found at https://youtu.be/2H3KvRWQqys. Do not use functions provided in the modern robotics package for manipulating transformation matrices such as RpToTrans().

Hint 1: Each axis can be considered as a line connecting the origin and the point $[0.3, 0]$ or $[0, 0.3]$ in that frame. You will need to use the homogeneous transformations to transfer these two axes/points back into the world/fixed frame. Example code showing how to display one frame is provided below.

Turn in: A copy of code used for animation and a video of the animation. The video can be uploaded separately through Canvas, and it should be in ".mp4" format. You can use screen capture or record the screen directly with your phone.